﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace RetailManagement.Models
{
    public class CustomerManager
    {
        private RetailManagementEntities re = new RetailManagementEntities();
        public void Add(CustomerDB cus)
        {
            Customer db = new Customer();
            db.Customer_FullName = cus.Customer_FullName;
            db.Password = cus.Password;
            db.Email = cus.Email;
            db.Address = cus.Address;
            db.Birthday = cus.Birthday;
            db.Phone = cus.Phone;
            db.Gender = cus.Gender;

            re.AddToCustomers(db);
            re.SaveChanges();
        }


        public bool IsCustomerIDExist(string email)
        {
            return (from o in re.Customers where o.Email == email select o).Any();
        }

        
    }
}